a, b = map(float, input().split())
k = int(a // b)
r = a - k * b
print(f"{r:.4f}")